$(function(){
		function openWindow(url){
			window.parent.$('#win').window({    
			    width:900,    
			    height:500, 
			    content:'<div style="overflow:hidden;width:100%;height:100%;"><iframe src="'+url+'" frameborder="0" width="100%" height="100%"><iframe></div>',
			    modal:true   
			});
		}
		$('#dg').datagrid({    
		    url:'/gaspider/test/fun.do', 
		    fit:true,
		    pagination:true,
		    idField:"id",
		    fitColumns:true,
		    toolbar: [{
				iconCls: 'icon-add',
				text:'新增',
				handler: function(){openWindow('/gaspider/webpage/keywords/add.jsp');}
			},'-',{
				iconCls: 'icon-edit',
				text:'编辑',
				handler: function(){openWindow('/gaspider/webpage/keywords/edit.jsp');}
			},'-',{
				iconCls: 'icon-remove',
				text:'删除',
				handler: function(){openWindow();}
			}],
		    columns:[[    
					{
						field : 'id',
						title : 'id',
						width:200,
						align:'center'
					}, {
						field : 'username',
						title : 'username',
						width:200,
						align:'center'
					} ]]
		});
	});